package com.zhuss.core.processor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.core.version.SearchAppVersionBo;
import com.zhuss.common.PageVo;
import com.zhuss.core.db.dao.ext.AppVersionDao;
import com.zhuss.core.db.dao.gen.AppVersionMapper;
import com.zhuss.core.db.entity.AppVersion;

@Component("appVersionRead")
public class AppVersionRead {
	@Autowired
	private AppVersionMapper appVersionMapper;
	
	@Autowired
	private AppVersionDao  appVersionDao;
	
	/**
	 * 查看最新版本
	 * @return
	 */
	public Object selectTopOne() {
		AppVersion result = appVersionMapper.selectTopOne();
		return result;
	}
	
	
	public Object list(SearchAppVersionBo bo) {
		PageVo<AppVersion> result = new PageVo<AppVersion>();
        result.setPageNum(bo.getPageNum());
        result.setPageSize(bo.getPageSize());
        result.setItems(appVersionDao.listAll(bo));
        result.setTotal(appVersionDao.countListAll(bo));
		return result;
	}

}
